﻿// Copyright 2008 (c) Michael Reichenauer, SWEDEN. All rights reserved.
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PSMock.Implementation
{

	/// <summary>
	/// Contains data about mocked functions.
	/// </summary>
	public class MockedFunction
	{
		/// <summary>
		/// Gets or sets the meta data token, which is the function key based on the class
		/// and function name.
		/// </summary>
		public int MetadataToken { get; set; }

		/// <summary>
		/// Gets or sets the exception to be thrown when mocked (null if not throwing).
		/// </summary>
		public Exception ThrowException { get; set; }

		/// <summary>
		/// Gets or sets the mock functionality, which replaces the original functionality.
		/// </summary>
		public Delegate Function { get; set; }

		/// <summary>
		/// Gets or sets the value to return for a mocked function
		/// </summary>
		/// <value>The return value.</value>
		public object ReturnValue { get; set; }

		/// <summary>
		/// Gets or sets the condition delegate, which determine if the call should be mocked by this
		/// mocked function or not.
		/// </summary>
		public Delegate Condition { get; set; }

		/// <summary>
		/// Gets or sets the instance for the mocked function. Is null if static function or if the
		/// function should be mocked for all instances.
		/// </summary>
		public object Instance { get; set; }
	}
}
